<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.lable.drugqualityspecSeeStd"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="${ctx}/lib/js/html5shiv.min.js"></script>
        <script src="${ctx}/lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
                            
    <section class="content-header">
        <h1>药品申报查询</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
              <li><a href="#">交易</a></li>
              <li><a href="#">缺货申报</a></li>
              <li><a href="#">药品申报查询</a></li>

        </ol>
    </section>
        
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
             <form action="${ctx}/stdDrugQualitySpec/exportExcel.html" id="exportExcel" method="post">
             <input id="fileName" name="fileName" type="hidden" value="<spring:message code="message.lable.drugqualityxls"/>" />
                <div class="input">
                	<div class="textalign1">通用名<spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugQualitySpecName" name="qualityspecName" placeholder="通用名" maxlength="200"  />
                    </div>
                    <div class="textalign"><spring:message code="message.listForm.pinGuiBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugQualitySpecCode" name="qualityspecCode" placeholder="<spring:message code="message.listForm.pinGuiBianMa"/>" maxlength="100" />
                    </div>
                    
                    <div class="textalign"><spring:message code="message.listForm.jiXing"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="formname" name="formName" placeholder="<spring:message code="message.listForm.jiXing"/>" maxlength="200" />
                    </div>
                </div>
              
                <div class="input">
                    <div class="textalign1"><spring:message code="message.listForm.guiGe"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="specname" name="specName" placeholder="<spring:message code="message.listForm.guiGe"/>" maxlength="200" />
                    </div>
                    <div class="textalign" >
                         <button id="selectSpec" type="button" onclick="gridSerch();" class="btn btn-success btn-sm"><spring:message code="message.button.seachSpacing"/></button>
                    </div>
                </div>
            </form>
            	<form id='form1' action="${ctx}/baseShortage/toDeclare.html" method="post">
            		<input type='hidden' id="drugQualitySpecName1" name="qualityspecName"  />
            		<input type='hidden' id="drugQualitySpecCode1" name="qualityspecCode"  />
            		<input type='hidden' id="formname1" name="formName" />
            		<input type='hidden' id="specname1" name="specName" />
            	</form>
            </div>
          </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
    </section>
      <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
  //绑定回车
    $('#drugQualitySpecCode,#drugQualitySpecName,#formname,#specname,#status').bind('keydown', function(event) {
        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
            $('#selectSpec').click();
        }
    }); 
  
    $("#drugQualitySpecName").focus();//加载页面光标在第一个查询框内
        function gridSerch(page) {
            var drugQualitySpecCode = $.trim($("#drugQualitySpecCode").val());
            var drugQualitySpecName = $.trim($("#drugQualitySpecName").val());
            var formName = $.trim($("#formname").val());
            var specName = $.trim($("#specname").val());
            var status = $.trim($("#status").val());
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{"drugQualitySpecCode":drugQualitySpecCode, "drugQualitySpecName":drugQualitySpecName, "formName":formName, "specName": specName,"status":status},
                page : (page || 1)
            }).trigger("reloadGrid"); //重新载入  
        }
    
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/baseShortage/getFeedbackListByHosp.html",
                mtype: "post",
                datatype: "json",
                autowidth: true,
            //    height: 310,
                colNames: [
                    '<spring:message code="message.jqGrid.cz"/>',//操作
                    '<spring:message code="message.listForm.pinGuiBianMa"/>', 
                    '通用名', 
                    '<spring:message code="message.listForm.JiXingMingCheng"/>', 
                    '<spring:message code="message.listForm.GuiGeMingCheng"/>',
                    '申报日期','阅读状态','卫生局核实日期','中心核实日期','审核状态','中心反馈结果'
                    
                ],
                colModel: [
                    { name: 'operate', width: 35, align:"center", sortable: false,
                    	   formatter : function(val, opts, rowdata) {
                    		   return str = "<a href=\"${ctx}/baseShortage/toFeedbackDetailInfo.html?shortageId="+rowdata.shortage_id+"&hospClassify="+rowdata.hospClassify+" \" style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='详情'></a>";
                         }
                    },
                    { name: 'qualitySpecCode', width: 80, align:"center", sortable: false },
                    { name: 'qualitySpecName', width: 100, align:"left", sortable: false},
                    { name: 'formName', width: 60, align:"center", sortable: false},
                    { name: 'specName', width: 110, align:"center", sortable: false},
                    { name: 'submit_datetime', width: 60, align:"center", sortable: false,formatter:function(val){
                    	if(val){
                    		return new Date(val).format("yyyy-MM-dd");	
                    	}
                    	return "";
                    }},
                    { name: 'is_readed', width: 40, align:"center", sortable: false},
                    { name: 'bur_audit_datetime', width: 65, align:"center", sortable: false,formatter:function(val){
                    	if(val){
                    		return new Date(val).format("yyyy-MM-dd");	
                    	}
                    	return "";
                    }},
                    { name: 'cet_audit_datetime', width: 60, align:"center", sortable: false,formatter:function(val){
                    	if(val){
                    		return new Date(val).format("yyyy-MM-dd");	
                    	}
                    	return "";
                    	
                    }},
                    { name: 'status', width: 60, align:"center", sortable: false,
                    	formatter:function(val, opts, rowdata){
                    		return "<span class='"+rowdata.statusColor+"'>"+val+"<span>"
                    	}},
                    { name: 'feedbackForm', width: 60, align:"center", sortable: false}
                    
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: false, 
                viewrecords: true,
                caption: "申报查询列表",//品规列表
                gridComplete:function(){
                	//序号列宽度自适应（参数为jqgridID）
                    autoRNWidth("gridlist");
                },
                jsonReader: {
                    id: "qualitySpecId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
            $("#gridlist").jqGrid("setGridHeight", create());
        });
        var scope ={
        		toDeclare:function(_drugQualitySpecCode){
        			$('#drugQualitySpecCode1').val(_drugQualitySpecCode);
        			$('#drugQualitySpecName1').val(_drugQualitySpecName);
        			$('#formname1').val(_formname);
        			$('#specname1').val(_specname);
        			$('#form1').submit();
        		}
        }
    </script>
</body>
</html> 
                          
                  
                  